<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">

        <ui:define name="content">
            <h:form >
                <p:panel toggleable="true" id="inventoryView" header="Inventory Overview">
                    <h:panelGrid columns="3">
                        <h:outputLabel value="Total Usage= #{rawMaterialEntityController.totalRMUsage}"/>
                        <p:spacer width="60" height="10"/>
                        <h:outputLabel value="Total Capacity= #{rawMaterialEntityController.totalRMCapacity}"/>
                    </h:panelGrid>

                    <h:panelGrid cellpadding="5" width="400" border="3" columns="2">
                        <h:outputText value=""/>
                        <h:outputText value="Total"/>
                        <h:outputLabel value=""/>

                        <h:outputText value="Almonds"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalAlmonds}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>
                        <p:commandButton update="inventoryView" action="#{rawMaterialEntityController.removeRMFromInventory}">
                                 <f:setPropertyActionListener target="#{rawMaterialEntityController.currentRMString}" value="Almonds"/>
                        </p:commandButton>
                        
                        <h:outputText value="Apples"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalApples}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Apricots"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalApricots}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Oats"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalOats}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Wheat Germ"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalWheatGerm}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Cinnamon"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalCinnamon}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Nutmeg"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalNutmeg}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Cloves"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalCloves}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Honey"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalHoney}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Vit Mineral Powder"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalVitMineralPowder}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Carob Chips"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalCarobChips}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Protein Powder"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalProteinPowder}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Cocoa Powder"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalCocoaPowder}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Hazelnuts"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalHazelnuts}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Cashew Nuts"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalCashewNuts}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Walnuts"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalWalnuts}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Macadamias"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalMacadamias}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Redcurrants"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalRedcurrants}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Raisins"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalRaisins}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Dates"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalDates}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Kiwis"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalKiwis}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>

                        <h:outputText value="Peaches"/>
                        <h:outputLabel style="table-layout: center" value="#{rawMaterialEntityController.totalPeaches}"/>
                        <p:spinner max="#{rawMaterialEntityController.totalAlmonds}" value="#{rawMaterialEntityController.amtToRemove}"/>
                    </h:panelGrid>

                </p:panel>
                <br/>
            </h:form>


        </ui:define>
    </ui:composition>

</html>
